package app1.rapidsquare.com.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;

import app1.rapidsquare.com.Utility.Utility;
import app1.rapidsquare.com.activity.R;

/**
 * Created by Hikmat on 03.09.2014.
 */
public class SocialProfileActivity extends AgileActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_social_profile);
        mImageViewMenu.setImageResource(R.drawable.logo_landscape);
        mImageViewLogo.setImageResource(R.drawable.narrow_back);
        mImageViewLogo.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                onBackPressed();
                finish();
            }
        });

        String url = null;
        if (getIntent().hasExtra("SocialUrl")) {
            url = getIntent().getStringExtra("SocialUrl");
        }

        WebView mWebView = (WebView) findViewById(R.id.webViewSocialProfile);
        mWebView.setVerticalScrollBarEnabled(false);
        mWebView.setHorizontalScrollBarEnabled(false);
        mWebView.getSettings().setJavaScriptEnabled(true);
        if (!Utility.isNullOrEmpty(url))
            mWebView.loadUrl(url);
        else {
            mWebView.stopLoading();
            setResult(RESULT_CANCELED, new Intent());
            finish();
        }
        mWebView.getSettings().setSavePassword(false);
        mWebView.getSettings().setSaveFormData(false);
    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    @Override
    protected void onPause() {
        super.onPause();
    }

    @Override
    public void onBackPressed() {
        super.onBackPressed();
        finish();
    }

    @Override
    protected void getResponce(String result) {

    }
}
